package com.wuzhiming.istudy.service.impl;

import com.wuzhiming.istudy.pojo.User;
import com.wuzhiming.istudy.service.BaseService;
import com.wuzhiming.istudy.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: UserServiceImpl
 * @Description:
 * @Author:zhimingw
 * @Version 1.0
 * @since 2022/3/16 19:05
 */
@Service("userService")
public class UserServiceImpl extends BaseService implements UserService {
    @Override
    public User queryById(Integer id) {
        return userMapper.queryById(id);
    }

    @Override
    public User queryByName(String name) {
        return userMapper.queryByName(name);
    }

    @Override
    public User queryUser(User user) {
        return userMapper.queryUser(user);
    }

    @Override
    public boolean insertUser(String name, String password) {
        if(userMapper.insertUser(name,password)==1){
            return true;
        }
        return false;
    }

    @Override
    public boolean update(User user) {
        if(userMapper.update(user)==1){
            return true;
        }
        return false;
    }

    @Override
    public List<User> queryAll() {
        return userMapper.queryAll();
    }
}
